Hi and welcome back.
So first we want to rename our Jupiter notebook from untitled to let's say.
Thanks.
So we are here on the Python basic section.
And before we start coding we want to structure our notebook a little bit.
So this is the good thing off to be the notebooks that we can combine code and text.
And first of all we want to create a heading and therefore we have to change the setting of our set.
So here we can see it's in the code setting and we want to create a heading which is a text actually
and therefore we need in the markdown setting.
And here we are already in the command mode and if you press and the M clear we can switch to markdown
and alternatively we can also switch to markdown by just here going to the drop down menu and select
markdown.
All right.
So now we can go into the cell and we want to create a headings.
So we need to press the hash key and then make a space in there.
Consider the font size already increases and then we can write our headings so let's call our heading
Python basics and then we can run the set by pressing shift enter.
So now here we have our heading and we are automatically in the next center and we want to make a subheading
and first of all here we have to select the markdown mode and all we want to create a soft pedal.
So we take two hash keys and an empty space and let's say we want to enumerate our session.
So this is the first session about the first steps
so we can see with two hash keys our font size is a little bit smaller than um our header here was the
one hash key.
So let's run here.
So now before we want to create our first code we want to explain what we will do in this session here.
That's against select markdown and then let's explain in this session you have to learn the basics of
Python
All right.
So now we are finished with all our headings in our description and now we want to stop coding and before
we are again going to the command mode here and pressing the B key a few times so we add some lines
here and then we are going here to our first line and what we can do we are we can say okay we have
a five here and we can just print out the five.
So the input is five and the output of our code is five so five is simply five.
As you can see here yeah actually we can use python as a calculator to perform basic mathematical operations.
So for example we can make an addition of five plus one gets six and we can solve strict.
So for example five minus one gets us for
and of course we can also multiply five times to gets 10 and we can also make an exponential so we can
say five to the power of two gives twenty five and we can also divide so we can say five slashes um
divided by two.
And discuss 2.5 and Ann Pace and s and the fangs and type
and in the brackets you can pass an object like here our number four or 2.5.
And the function type checks.
Then what data type the object that was passed in the brackets.
Um yeah.
Yes actually.
So let's try to find out what five.
Which data type it is.
And it's in that uh so an integer is just a number without any decimals.
And we can also check the data type of 2.5
and 2.5 as a float object.
So a float object tests in some decimals after the point here so the type function as the other first
example of a function in Python.
So you can parse an object like 5 or 2.5 within the brackets of the function and then the function does
something with the object and in this case it determines and the data type of object.
Now you could ask what is in objects on Python.
Everything is an object cost Python is an object oriented programming language.
However at this point I do not want to go into details of object oriented programming.
So what is important for you is actually that the each element we are working with.
So for example here the 5 for 2.5 is an object and python and objects can be of different data types.
So Fyfe isn't in the john 2.5 is a float object and different data types have different functionalities
but we will learn more about it and the next session's about into just float strings and so on.
So what we can do now we can type something here in quotation mark let's say Doc and it returns our
stock.
So now again let's add some lines service that's the key key and if you check the type of dog it gives
us the string so dog is a string object and string object is actually a sequence of characters which
was created within quotation marks.
So my name is Alex and I can just write here my name in quotation mark and uh this is a string also.
However what does not work.
We cannot just write dark here.
So this drops us an error message and says and the name Dog is not defined so when we write dark here
without quotation marks.
Python assumes that Doc is viable which was defined earlier but yeah it does not find any information
on the variable dog.
So and then it drops them an error message.
And of course the will learn later was Latin revivalists in detail.
But now let's go on with one more thing we want to learn so let's assume here in a set of we want to
make two calculations so let's say five plus two and then four minus one.
And then if you run the third we only get the result of the last statement and our side so far minus
one gives us three but this does not mean that and do not say I calculate also five plus two and actually
pace and thus calculate five plus two.
But we do not see it here in the output and if you want to print a many statements we have to use and
the function print so print is also a function
and within the brackets we can pass an statement which we want to see in the output.
So for example five plus two and again we can take four minus one and if we run the set now we get to
the output of both statements so five plus to give seven and four minus one gives us three and we can
also pass both calculations within the brain function so we can say print five plus two comma and Four
minus one guess seven and three but this is also an advantage of Jupiter notebook if we only want to
print let's say five.
We can just type five and around the set and this gives us five.
So we do not have to explicitly say here please print me five so encoding environments other than to
put a notebook we always have to use in the print function but the two bits are not book notes here
in this example okay I should print five.
So we do not have to explicitly write print here and took it a notebook but it gives the actually the
same result.
All right so this some of the basics of Python and then the next session we will have a look at a variable.
So I hope to see you there by.